package org.yf.samples.model;

import java.util.Date;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

public class ExamUserVO {

	@NotEmpty( message = "ID不能为空")
	@Pattern(regexp = "^[0-9]*$", message = "ID必须是整数")
	@Size(max = 10, message = "长度不能超过10个字符")
	private String userId;
	
	@NotEmpty( message = "姓名不能为空")
	@Size(max = 45, message = "长度不能超过45个字符")
	private String userName;

	private String password;
	
	@NotEmpty( message = "联系电话不能为空")
	@Pattern(regexp = "^{0}|((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$", message = "电话号码格式无效")
	private String tel;

	private String email;

	@NotEmpty( message = "地址不能为空")
	private String address;
	
	@NotEmpty( message = "生日不能为空")
	@Pattern(regexp = "^{0}|(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$", message = "日期格式无效")
	private String birthday;

	private String gender;

	private Date lastLockTime;

	private int loginFailCount;
	
	private int userRole;

	public ExamUserVO() {
		super();
	}

	public ExamUserVO(String userId, String userName, String password, String tel, String email, String address,
			String birthday, String gender, Date lastLockTime, int loginFailCount) {
		super();
		this.userId = userId;
		this.userName = userName;
		this.password = password;
		this.tel = tel;
		this.email = email;
		this.address = address;
		this.birthday = birthday;
		this.gender = gender;
		this.lastLockTime = lastLockTime;
		this.loginFailCount = loginFailCount;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getLastLockTime() {
		return lastLockTime;
	}

	public void setLastLockTime(Date lastLockTime) {
		this.lastLockTime = lastLockTime;
	}

	public int getLoginFailCount() {
		return loginFailCount;
	}

	public void setLoginFailCount(int loginFailCount) {
		this.loginFailCount = loginFailCount;
	}

	public int getUserRole() {
		return userRole;
	}

	public void setUserRole(int userRole) {
		this.userRole = userRole;
	}
	
}
